<template>
<div>
  <h1>用户展示</h1>
  <el-table
    :data="tableData"
    style="width: 100%">

    <el-table-column
      label="名称"
      width="100">
      <template slot-scope="scope">
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.cname }}</el-tag>
          </div>
      </template>
    </el-table-column>

    <el-table-column
      label="地址"
      width="240">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.site }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="联系人姓名"
      width="240">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.username }}</span>
      </template>
    </el-table-column>

    <el-table-column
      label="联系人电话"
      width="240">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.phone }}</span>
      </template>
    </el-table-column>

    

  </el-table>
</div>  
</template>
<style>

</style>
<script>
import { showclient_post } from './axios_api/api';
  export default {
    data() {
      return {
        tableData: [],
      }
    },
    mounted(){
        this.genrelist();
    },
    methods: {
        genrelist(){
            showclient_post().then(resp=>{
                this.tableData = resp.client_list;
            })
        },
      handleEdit(index, row) {
        console.log(index, row);
      },

    }
  }
</script>
